<table id="quyengroups_flex" style="display:none"></table>
<script type="text/javascript">
	$("#quyengroups_flex").flexigrid({
		url: 'modules/quyengroups/gd.php?magrp='+encodeURI('<?php echo $_GET["magrp"];?>'),
		dataType:"xml",
		colModel : [
			{display: 'id', name : 'id', width : 100, sortable : true, align: 'center',hide:true},
			{display: 'Mã module', name : 'mamod', width : 100, sortable : true, align: 'center',hide:true},
			{display: 'Module', name : 'tenmod', width : 200, sortable : true, align: 'center'},
			{display: 'Xem', name : 'select_r', width : 50, sortable : true, align: 'right'},
			{display: 'Thêm', name : 'insert_r', width : 50, sortable : true, align: 'right'},
			{display: 'Sửa', name : 'update_r', width : 50, sortable : true, align: 'right'},
			{display: 'Xóa', name : 'delete_r', width : 50, sortable : true, align: 'right'}
			],
		searchitems : [
			{display: 'Module', name : 'tenmod', isdefault: true},
			{display: 'Xem', name : 'select_r'},
			{display: 'Thêm', name : 'insert_r'},
			{display: 'Sửa', name : 'update_r'},
			{display: 'Xóa', name : 'delete_r'}
			],
		usepager: true,
		useRp: true,
		rp: 20,
		showTableToggleBtn: true,
		width: 500,
		height: 300,
		singleSelect:true,
		onSuccess:function(){
			if(quyengroups_id!="")
			{
				$("#quyen_flex #row"+quyengroups_id).addClass("trSelected");
			}
			else $("#quyen_flex tr:last").addClass("trSelected");
		}
	});
</script>